package com.example.education.dao;

import com.example.education.model.Reply;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component
public interface ReplyMapper {
    /**
     * 新增回复
     * @param reply
     * @return
     */
    Integer insertReply(@Param("reply") Reply reply);

    /**
     * 删除回复
     * @param replyId
     * @return
     */
    Integer deleteReply(@Param("replyId")Integer replyId);

    /**
     * 点赞回复
     * @param replyId
     * @return
     */
    Integer likeReply(@Param("replyId")Integer replyId,@Param("likeNum")Integer likeNum);

    /**
     * 根据编号查询回复
     * @param replyId
     * @return
     */
    Reply getReplyById(@Param("replyId")Integer replyId);

    /**
     * 根据回复父id和类型查询回复
     * @param replyCate 回复类型
     * @param replyPid 回复Pid
     * @return
     */
    List<Reply> getRelyByCateAndPid(@Param("replyCate")Integer replyCate,@Param("replyPid")Integer replyPid);
}